T = int(input())
for x in range(1, T + 1):
    length,n=input().split(" ")
    text=input().split(' ')
    length=int(length)
    n=int(n)
    s=list()
    for i in text:
        if i.isdigit():
            s.append(int(i))
    ans=0
    for i in range(length):
        j=0
        while i+j<length and s[i+j]==n-j:
            j+=1
        if j==n:
            ans+=1
    print("Case #{}: {}".format(x, ans), flush = True) 